package com.gsdse.controller;

import com.gsdse.pojo.ReturnData;
import com.gsdse.service.UpLoadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class UploadController {

    @Autowired
    private UpLoadService upLoadService;

    @PostMapping("/uploadPic")
    public ReturnData uploadPic(@RequestParam("file") MultipartFile file,@RequestParam("departmentId") String departmentId) {
        return upLoadService.uploadPic(file,departmentId);
    }
}
